/*
 * Author: vdaras
 */

#include "ReferenceCounted.h"

/**
 * Constructor initializes references to 1.
 */

ReferenceCounted::ReferenceCounted()
:
m_refCount(1)
{
}


ReferenceCounted::~ReferenceCounted()
{
}


/**
 * Increases references to this object.
 */

void ReferenceCounted::IncRef()
{
    ++m_refCount;
}


/**
 * Decreases references to this object. If the reference count reaches zero
 * frees the object.
 */

void ReferenceCounted::DecRef()
{
    --m_refCount;
}

